package com.keelau.ui.fx;

import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;

public class ComponentUtils {

    public static Border getBorder(Color color){
        Color color1 = color;
        if(color1==null) color1 = Color.color(1,0,0);
        return  new Border(new BorderStroke(color1, BorderStrokeStyle.SOLID,null,new BorderWidths(3)));
    }

    public static void fillParent(Node node){
        AnchorPane.setBottomAnchor(node,0.0);
        AnchorPane.setTopAnchor(node,0.0);
        AnchorPane.setLeftAnchor(node,0.0);
        AnchorPane.setRightAnchor(node,0.0);
    }

    public  static void showMessage(String msg){
        Alert alert = new Alert(Alert.AlertType.INFORMATION,msg);
        alert.show();
    }
}
